package net.demo.demo2;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

public class TcpClient {
    public static void main(String[] args) throws IOException {
        //创建socket对象
        Socket socket = new Socket("127.0.0.1", 10001);
        //获取输入流
        OutputStream os =socket.getOutputStream();
        //写入数据
        os.write("学的好烦".getBytes());

        os.close();

    }
}
